<?php
namespace Common\Behaviors;

//use Think\Controller;
class login extends \Think\Behavior{

    public function action_begin(){
        //验证登陆才能访问
        if($_SERVER['HTTP_HOST'] != 'company.ds.com' && $_SERVER['HTTP_HOST'] != 'admin.ds.com') return;

        $allow = [
            'system/verify',
            'system/login'
        ];

        $url = $_SERVER['PATH_INFO'];

        if(!in_array($url,$allow)) {
            if (empty($_SESSION['user'])) {
                die('<script>top.location = \'/login.html\';</script>');
            }
        }
    }

    //行为执行入口
    public function run(&$param){

    }

}